<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>

<script type="text/javascript">
<!--
	$(document).ready(function() {		
		$(":input[type=text]").bind({
			focus: showTooltip,
			blur: hideTooltip
		});

		$(":input[type=password]").bind({
			focus: showTooltip,
			blur: hideTooltip
		});
		
		$("#birthday").mask("99/99/9999");

		$.subscribe('success', function(event,data) {
			var text = event.originalEvent.request.responseText;
			if(text.search('ui-state-error') == -1) {
				$('#signUpBuyerForm :input').attr('disabled', true);
				$('#signUpBuyerForm label').css('color', 'grey');
			}
		});
	});
//-->
</script>

<div id="signUpBuyerResult"></div>
	
<s:form id="signUpBuyerForm" action="sign-up-buyer-add" theme="simple">
  	<p>
		<label for="firstName" class="label"><s:text name="firstName"/><span class="required">*</span>:</label> 
   		<input type="text" id="firstName" name="firstName"/>
   		<span class="tooltip"><s:text name="tooltip.firstName"/></span>
	</p>
	<p>
		<label for="lastName" class="label"><s:text name="lastName"/><span class="required">*</span>:</label> 
   		<input type="text" id="lastName" name="lastName"/> 
   		<span class="tooltip"><s:text name="tooltip.lastName"/></span>
	</p>
	<p>
		<label for="email" class="label"><s:text name="email"/><span class="required">*</span>:</label> 
   		<input type="text" id="email" name="email"/>
   		<span class="tooltip"><s:text name="tooltip.email"/></span>
	</p>
	<p>
		<label for="password" class="label"><s:text name="password"/><span class="required">*</span>:</label> 
   		<input type="password" id="password" name="password"/>
   		<span class="tooltip"><s:text name="tooltip.password"/></span>
	</p>
	<p>
		<label for="password2" class="label"><s:text name="password2"/><span class="required">*</span>:</label> 
   		<input type="password" id="password2" name="password2"/> 
   		<span class="tooltip"><s:text name="tooltip.password2"/></span>
	</p>
	<p>
		<label for="gender" class="label"><s:text name="gender"/><span class="required">*</span>:</label> 
   		<s:radio name="gender" key="gender" list="#{'M':'Male','F':'Female'}"/> 
	</p>
  		<p>
		<label for="birthday" class="label"><s:text name="birthday"/><span class="required">*</span>:</label> 
   		<input type="text" id="birthday" name="birthday" value="" />
   		<span class="tooltip"><s:text name="tooltip.birthday"/></span>
	</p>
	<p class="buttonDiv">
		<img id="sub-indicator" src="images/indicator.gif" alt="Loading..." style="display:none"/>
  		<sj:submit targets="signUpBuyerResult" button="true" validate="true" indicator="sub-indicator" key="signup" onSuccessTopics="success"/>
	</p>
</s:form>